﻿using System;
using System.Collections.Generic;
using System.Text;
using UserSystemApi.Entity;

namespace UserSystemApi.Services.Account.Dto
{
    public class UserInputDto 
    {
        public int Id { get; set; } 
        public string? UserName { get; set; }
        public int Age { get; set; }
        public string? Title { get; set; }
        public DateTime? CreateTime { get; set; } 

        public static  Users ToUpdateUsers(ref Users user, UserInputDto userInputDto)
        {

            user.UserName = userInputDto.UserName;
            user.Age = userInputDto.Age;
            user.Title = userInputDto.Title;
            user.CreateTime = DateTime.Now;
            return user;
        }
        public static Users ToCreateUsers(UserInputDto userInputDto)
        {
            Users users = new Users
            {
                UserName = userInputDto.UserName,
                Age = userInputDto.Age,
                Title = userInputDto.Title,
                CreateTime = DateTime.Now,
            };
            return users;
        }
    }
}
